package com.example.scaffold.organization.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.scaffold.organization.entity.Organization;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 机构Mapper接口
 * 遵循阿里手册：DAO层命名规范，避免使用SELECT *查询
 *
 * @author example
 */
// @Mapper
public interface OrganizationMapper extends BaseMapper<Organization> {

    /**
     * 根据名称查询机构
     * 遵循阿里手册：参数绑定使用@Param注解
     *
     * @param name 机构名称
     * @return 机构信息
     */
    @Select("select * from sys_organization WHERE name = #{name} and is_deleted = 0")
    Organization selectByName(@Param("name") String name);
}